package network.util;

import java.io.IOException;
import java.net.Socket;

public class NetworkUtil {

	public static void checkSocketState(final Socket socket) throws IOException {
		if (socket.isClosed() || !socket.isConnected()
				|| socket.isInputShutdown() || socket.isOutputShutdown()) {
			throw new IOException("Socket is not ready to use.");
		}
	}
}
